
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel" type="{$type}">{$title}</h4>
            </div>
            <div class="modal-body">
                    <div class="row clearfix">
                            <div class="col-md-12 column">
                                <div class="alert alert-dismissable alert-info">
                                <button type="button" class="close">×</button>
                                <p></p>
                                </div>
                            </div>
                        </div>
                <form action="" class="formbox">
                <table class="table table-striped table-hover ntTable" style="padding-top:0">
                    <tbody>
                        <tr>
                            <td>{:lang("abbreviation")}<span class="required"></span></td>
                            <td>
                                <input type="text" class="form-control" id="abbreviation" name="thum" placeholder="{:lang('abbreviation')}" {if isset($abbreviation)}readonly{/if} value="{if isset($abbreviation)}{$abbreviation}{/if}">
                            </td>
                        </tr>
                        {if isset($language)}
                        {foreach $language as $k=>$v}
                        <tr>
                            <td>{$v.name}<span class="required"></span></td>
                            <td>
                                <input type="text" class="form-control langeput" id="" code="{$v.code}" name="content" placeholder="{$v.name}" value="{if isset($v.content)}{$v.content}{/if}">
                            </td>
                        </tr>
                        {/foreach}
                        {/if}
                     
                    </tbody>
                </table>
            </form>
            </div>
            <input type="hidden" id="ids" value="{if isset($ids)}{$ids}{/if}">
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:lang('cancel')}</button>
                <button type="button" class="btn btn-primary save" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>{:lang('save')}</button>
            </div>
<script type="text/javascript">
    $('.save').click(function(){
        if($('#ntModalLabel').attr('type') == 'add'){
            var url ='/admin/multilanguage/addopen?request=insert';
        }else{
            var url ='/admin/multilanguage/editopen?request=update&ids='+$('#ids').val();
        }
        var data={val:[]}
        $('.langeput').each(function(){
            data.val.push({
                [$(this).attr('name')]:$(this).val(),
                lang:$(this).attr('code'),
                abbreviation:$('#abbreviation').val(),
            })
        })
        console.log(data)
         $.ajax({
            url: url,
            type: 'post',
            data,
            success: function (data) {
                data = JSON.parse(data)
                if(data.status==1){
                    change_mes_type('.alert',data.status)
                    $('.alert').show()
                    $('.alert p').html('*'+data.msg+'<br>')
                    $('#multilanguage_editModal').modal('hide')
                }else{
                    change_mes_type('.modal-body .alert',data.status)
                    $('.modal-body .alert').show()
                    $('.modal-body .alert p').html('*'+data.msg+'<br>')
                    state=true
                }
            }
        }) 
    });
</script>
